<script setup>
import { onMounted, ref } from 'vue'
import { getArticleChannelService } from '@/api/article.js'
const channelListArr = ref([])
const getChannelListArr = async () => {
  const res = await getArticleChannelService()
  channelListArr.value = res.data.data
}
onMounted(() => {
  getChannelListArr()
})

defineProps({
  modelValue: { type: [Number, String] },
  width: {
    type: String,
  },
})
const emit = defineEmits(['update:modelValue'])
</script>
<template>
  <el-form-item style="width: 100%">
    <el-select
      :modelValue="modelValue"
      @update:modelValue="emit('update:modelValue', $event)"
      style="width: 100%"
    >
      <el-option
        v-for="item in channelListArr"
        :key="item.id"
        :label="item.cate_name"
        :value="item.id"
      ></el-option>
    </el-select>
  </el-form-item>
</template>
